package com.yunduo.mapper;

import com.yunduo.entity.Good;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ChengXin
 * @since 2023-07-12
 */
public interface GoodMapper extends BaseMapper<Good> {
    //根据分类id查找数据
    List<Good> selectGoodByTypeId(@Param("ids") List<String> ids);
    //根据ids 查找最新的n个商品
    List<Good> seletGoodByIdsOrderPop(@Param("ids")  List<String> ids,@Param("count") int count);
    //查找最新的n个商品
    List<Good> seletGoodByOrderPop(@Param("count") int count);
    //随机查找n个商品
     List<Good> selectGoodsForN(@Param("begin")int begin,@Param("end") int end);
    // 按价格 ,上架日期,是否售卖排序
    List<Good> selectGoodsForOrderQuery(@Param("name")String name,@Param("price") boolean orderPirce,@Param("create") boolean orderCreate,@Param("page") int page,@Param("item") int item);
}
